26 Commits

Author SHA1 Message Date
Jacek Sieka
2c2544aec1
byteutils: openArray[char] version of toBytes (#210)
and compile-time tests
2023-11-14 11:53:47 +01:00
tersec
326ef09a46
remove dead code under Nim 1.6+ (#206) 2023-07-31 21:07:48 +00:00
jangko
6cc42beac7
reenable Defect raises for Nim 1.2 2023-02-14 21:56:10 +07:00
jangko
faabd40c30
reduce compiler warnings 2023-02-14 21:35:54 +07:00
Jacek Sieka
32d6f43fff
byteutils: allow empty output buffers (#157)
* byteutils: allow empty output buffers

* er, closed
2023-01-19 08:19:26 +01:00
Miran
d37e77a72b
make it more Nim 1.4+ compatible (#131)
* make it more 1.6-compatible

* these changes are from 1.4 forward
2022-07-26 17:52:59 +00:00
Zahary Karadjov
f75c0a273a
[skip ci] consistent formatting 2022-06-17 11:39:35 +03:00
zah
9fe9cb7002
Add byteutils.hexToByteArrayStrict (#120) 2022-06-17 11:37:06 +03:00
Dustin Brody
bb73567168
don't disable checks in ptrops 2022-03-16 17:02:32 +00:00
Jacek Sieka
17cd8c846f
add to0xHex which returns a 0x-prefixed hex string 2022-01-06 17:05:47 +01:00
Michael Bradley
4750020a44
byteutils: drop import of assign2 since arrayops imports/exports it (#100)
Closes #99
2022-01-06 08:32:29 +01:00
Jacek Sieka
8a405309c6
enable styleCheck:usages (#93) 2021-12-02 16:24:02 +01:00
Zahary Karadjov
ee78822e05
Alternative definition of string.hexToByteArray(N)
This definition is more robust. The previously existing version was
producing compilation errors in certain generic contexts. static
"regular" params are recommended in general as they are more flexible
than the explicit generic parameters.
2021-03-19 03:56:01 +02:00
Jacek Sieka
d8d914332d
random helpers (#64)
* random helpers

* arrayops as a home for small array/openArray utilities
* assign2 - a replacement for genericAssign and assignment operators in
general which in nim are very slow
* use assign2 in a few places to speed things up

* fixes

* fixes
2020-12-10 12:05:22 +01:00
Zahary Karadjov
61d5cfc376
Add array[N, byte].fromHex(string) 2020-07-02 18:00:39 +03:00
Zahary Karadjov
c980d7592d
Missed some generic procs in the previous commit due to late instantiation 2020-07-02 13:00:38 +03:00
Zahary Karadjov
a272986cb3
raises annotations for stew/byteutils 2020-07-02 12:48:05 +03:00
Jacek Sieka
720f1a254d
byteutils: compile-time to/fromBytes (#35) 2020-05-06 15:51:07 +02:00
Jacek Sieka
8065e36c5a
results: fix non-void [] overload 2020-04-23 06:46:10 +02:00
Jacek Sieka
87ccf8e66b hex byte: raise instead of assert on hex-to-byte odd lengths 2020-04-10 22:40:00 +03:00
Jacek Sieka
76beeb769e
fix fromBytes for zero length arrays 2020-03-07 23:29:46 +01:00
Jacek Sieka
ca8fb7ebd0 add slice assignment for openarray 2020-03-05 12:11:25 +02:00
Jacek Sieka
598fe151f8 non-cast implementation of toBytes, add fromBytes 2020-03-05 12:11:25 +02:00
Jacek Sieka
9c18a1cc55
byteutils: lexicographical less than 2019-12-19 13:29:38 +01:00
Jacek Sieka
cf4df3dc50 add toBytes (#14) 2019-12-10 15:39:57 +01:00
Jacek Sieka
c95cee45bc
add byteutils 2019-07-06 20:07:41 +02:00