mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-12-22 04:27:58 +01:00
[core] Add RandomUtil.fillWithSecureRandom(byte[])
This commit is contained in:
parent
7cf0112487
commit
17ac41c8cb
1 changed files with 5 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2003-2007 Jive Software, 2016-2019 Florian Schmaus.
|
||||
* Copyright 2003-2007 Jive Software, 2016-2021 Florian Schmaus.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -47,4 +47,8 @@ public class RandomUtil {
|
|||
public static int nextSecureRandomInt() {
|
||||
return SECURE_RANDOM.get().nextInt();
|
||||
}
|
||||
|
||||
public static void fillWithSecureRandom(byte[] bytes) {
|
||||
SECURE_RANDOM.get().nextBytes(bytes);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue