1
0
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:
Nick Treleaven
2021-02-17 19:47:19 +00:00
committed by GitHub
parent 4ccf991f61
commit 33d8074846
5 changed files with 13 additions and 44 deletions

View File

@ -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
}