mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
crypto.rand: use byteptr.vbytes instead of c_array_to_bytes_tmp (#8786)
This commit is contained in:
@ -7,20 +7,3 @@ module rand
|
||||
const (
|
||||
read_error = error('crypto.rand.read() error reading random bytes')
|
||||
)
|
||||
|
||||
// NOTE: temp until we have []bytes(buff)
|
||||
fn c_array_to_bytes_tmp(len int, buffer voidptr) []byte {
|
||||
|
||||
mut arr := []byte{len:len, cap:1}
|
||||
arr.data = buffer
|
||||
/*
|
||||
|
||||
arr = array {
|
||||
len: len
|
||||
cap: 1
|
||||
element_size: 1
|
||||
data: buffer
|
||||
}
|
||||
*/
|
||||
return arr
|
||||
}
|
||||
|
Reference in New Issue
Block a user