nim - MD5 on an array, array[0..63, uint8] to cstring conversion -
i'm trying perform md5update on array[0..63, uint8] i'm getting
error: type mismatch: got (md5context, array[0..63, uint8], int) expected 1 of: md5.md5update(c: var md5context, input: cstring, len: int)
it seems wants ctring input , not buffer. how can perform md5update() on binary data? (i don't want null character @ end...)
you can cast buffer cstring
cast[cstring](addr mybuf)
. note have pass var md5context
, means has mutable (defined inside var
or passed var
parameter).
Comments
Post a Comment