diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2016-04-08 13:41:52 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2016-04-08 13:41:52 +0200 |
commit | 4790e826491e753882a6da8b414db1ab34924620 (patch) | |
tree | 363be00a72830f3f328733024be3f09d1f32fa11 /id/server/idserverlib/src/main/java | |
parent | 5b3041239452f0f064a6fea1e68e9b2c96a181f2 (diff) | |
download | moa-id-spss-4790e826491e753882a6da8b414db1ab34924620.tar.gz moa-id-spss-4790e826491e753882a6da8b414db1ab34924620.tar.bz2 moa-id-spss-4790e826491e753882a6da8b414db1ab34924620.zip |
some Update of ELGA MandateService client implementation
Diffstat (limited to 'id/server/idserverlib/src/main/java')
-rw-r--r-- | id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/Random.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/Random.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/Random.java index 47f784c33..ba45a3679 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/Random.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/Random.java @@ -99,8 +99,12 @@ public class Random { char preFix = allowedPreFix[Math.abs(random.nextInt() % allowedPreFix.length)]; //generate ID - return preFix + new String(Hex.encodeHex(Bytes.concat(now.getBytes(), randValue))); // 20 bytes = 160 bits - + String returnValue = preFix + new String(Hex.encodeHex(Bytes.concat(now.getBytes(), randValue))); // 20 bytes = 160 bits + if (returnValue.length() > 40) + return returnValue.substring(0, 40); + else + return returnValue; + } |