Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8cb8720b56 | ||
|
|
c5039c1cc6 |
4 changed files with 6 additions and 9 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,5 +1,3 @@
|
|||
**/uuids
|
||||
|
||||
.vscode/.browse.*
|
||||
nimsuggest.log
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import strutils, hashes
|
||||
import isaac
|
||||
import urandom
|
||||
import uuids/urandom
|
||||
|
||||
type
|
||||
UUID* = object
|
||||
|
|
@ -20,7 +20,7 @@ template toHex(s: string, start: Natural,
|
|||
if n == 0 and x < 0: n = -1
|
||||
|
||||
proc uuidsParseHexInt(s: string, maxLen: int): int64 =
|
||||
if s.isNil or s.len == 0:
|
||||
if s.len == 0:
|
||||
raise newException(ValueError, "UUID part is empty")
|
||||
if s.len > maxLen or s.len > sizeof(result) * 2:
|
||||
raise newException(ValueError, "UUID part is longer than expected")
|
||||
|
|
@ -1,10 +1,9 @@
|
|||
[Package]
|
||||
name: "uuids"
|
||||
version: "0.1.9"
|
||||
version: "0.1.11"
|
||||
author: "Xored Software, Inc."
|
||||
description: "UUID library"
|
||||
license: "MIT"
|
||||
srcDir: "src"
|
||||
|
||||
[Deps]
|
||||
requires: "isaac >= 0.1.3"
|
||||
|
|
|
|||
|
|
@ -16,16 +16,16 @@ when defined(windows):
|
|||
proc CryptAcquireContext(
|
||||
phProv: ptr HCRYPTPROV, pszContainer: WideCString,
|
||||
pszProvider: WideCString, dwProvType: DWORD, dwFlags: DWORD
|
||||
): WinBool {.importc: "CryptAcquireContextW".}
|
||||
): WINBOOL {.importc: "CryptAcquireContextW".}
|
||||
else:
|
||||
proc CryptAcquireContext(
|
||||
phProv: ptr HCRYPTPROV, pszContainer: cstring, pszProvider: cstring,
|
||||
dwProvType: DWORD, dwFlags: DWORD
|
||||
): WinBool {.importc: "CryptAcquireContextA".}
|
||||
): WINBOOL {.importc: "CryptAcquireContextA".}
|
||||
|
||||
proc CryptGenRandom(
|
||||
hProv: HCRYPTPROV, dwLen: DWORD, pbBuffer: pointer
|
||||
): WinBool {.importc: "CryptGenRandom".}
|
||||
): WINBOOL {.importc: "CryptGenRandom".}
|
||||
|
||||
{.pop.}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue