You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
md5 docs says "Note: The procs in this module can be used at compile time.". However, toMD5 does not work.
Example
import md5
static:
block working:
doAssert(getMD5("Franz jagt im komplett verwahrlosten Taxi quer durch Bayern") =="a3cca2b2aa1e3b5b3b5aad99a8529074")
doAssert(getMD5("Frank jagt im komplett verwahrlosten Taxi quer durch Bayern") =="7e716d0e702df0505fc72e2b89467910")
block failing:
doAssert($toMD5("") =="d41d8cd98f00b204e9800998ecf8427e")
discardtoMD5("")
Current Output
nim/lib/system/memory.nim(21, 5) Error: cannot 'importc' variable at compile time; c_memset
Expected Output
compiles
Possible Solution
Looking at the code, there is no reason for md5 to use cstring/pointer behavior. There is already some use of openarray so it's puzzling why it doesn't use openarray in place of cstring/pointer as well, the buffer used is an array[0..63, uint8]. Same seems to go for endians/oids/sha1.
md5
docs says "Note: The procs in this module can be used at compile time.". However,toMD5
does not work.Example
Current Output
Expected Output
compiles
Possible Solution
Looking at the code, there is no reason for
md5
to usecstring
/pointer
behavior. There is already some use ofopenarray
so it's puzzling why it doesn't useopenarray
in place ofcstring
/pointer
as well, the buffer used is anarray[0..63, uint8]
. Same seems to go for endians/oids/sha1.Additional Information
The text was updated successfully, but these errors were encountered: