mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
crypto: implement rand.bytes(needed_bytes int) ?[]byte, use it consistently instead of the old rand.read(), which will change to be compatible with io and the pseudo random rand module
This commit is contained in:
@@ -21,7 +21,7 @@ import crypto.rand
|
||||
|
||||
fn main() {
|
||||
// remember to save this key somewhere if you ever want to decrypt your data
|
||||
key := rand.read(32) ?
|
||||
key := rand.bytes(32) ?
|
||||
println('KEY: $key')
|
||||
|
||||
// this data is one block (16 bytes) big
|
||||
|
||||
Reference in New Issue
Block a user