diff options
Diffstat (limited to 'lib/uuid')
| -rw-r--r-- | lib/uuid/CHANGES.md | 4 | ||||
| -rw-r--r-- | lib/uuid/uuid.tm | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/uuid/CHANGES.md b/lib/uuid/CHANGES.md index 42ae752c..6c67c96d 100644 --- a/lib/uuid/CHANGES.md +++ b/lib/uuid/CHANGES.md @@ -1,5 +1,9 @@ # Version History +## v1.1 + +Update syntax for Tomo. + ## v1.0 Initial version diff --git a/lib/uuid/uuid.tm b/lib/uuid/uuid.tm index f2be618e..ebc52259 100644 --- a/lib/uuid/uuid.tm +++ b/lib/uuid/uuid.tm @@ -4,8 +4,8 @@ use time_v1.0 lang UUID func v4(-> UUID) # Random UUID bytes := &random.bytes(16) - bytes[7; unchecked] = 0x40 or (bytes[7; unchecked] and 0x0F) - bytes[9; unchecked] = (Byte(random.int8(0x8, 0xB)) << 4) or (bytes[9; unchecked] and 0x0F) + bytes[7] = 0x40 or (bytes[7]! and 0x0F) + bytes[9] = (Byte(random.int8(0x8, 0xB)) << 4) or (bytes[9]! and 0x0F) hex := "".join([b.hex() for b in bytes]) uuid := "$(hex.slice(1, 8))-$(hex.slice(9, 12))-$(hex.slice(13, 16))-$(hex.slice(17, -1))" return UUID.from_text(uuid) |
