mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
crypto: add custom errors to crypto lib (#9522)
This commit is contained in:
@ -19,7 +19,7 @@ pub fn read(bytes_needed int) ?[]byte {
|
||||
// use bcrypt_use_system_preferred_rng because we passed null as algo
|
||||
status := C.BCryptGenRandom(0, buffer.data, bytes_needed, bcrypt_use_system_preferred_rng)
|
||||
if status != status_success {
|
||||
return read_error
|
||||
return IError(&ReadError{})
|
||||
}
|
||||
return buffer
|
||||
}
|
||||
|
Reference in New Issue
Block a user