parent
8a3b76b287
commit
a9bd78d579
23 changed files with 140 additions and 140 deletions
|
|
@ -44,7 +44,7 @@ proc hexbyte*(hex: char): int {.inline.} =
|
|||
|
||||
proc parseOid*(str: cstring): Oid =
|
||||
## Parses an OID.
|
||||
var bytes = cast[cstring](cast[pointer](cast[ByteAddress](addr(result.time)) + 4))
|
||||
var bytes = cast[cstring](cast[pointer](cast[int](addr(result.time)) + 4))
|
||||
var i = 0
|
||||
while i < 12:
|
||||
bytes[i] = chr((hexbyte(str[2 * i]) shl 4) or hexbyte(str[2 * i + 1]))
|
||||
|
|
@ -57,7 +57,7 @@ proc `$`*(oid: Oid): string =
|
|||
result.setLen 24
|
||||
|
||||
var o = oid
|
||||
var bytes = cast[cstring](cast[pointer](cast[ByteAddress](addr(o)) + 4))
|
||||
var bytes = cast[cstring](cast[pointer](cast[int](addr(o)) + 4))
|
||||
var i = 0
|
||||
while i < 12:
|
||||
let b = bytes[i].ord
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue