LUA-URI-URN-OID(3)

πŸ“¦
version 0.1+20130926+git14fa255d Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu questing

πŸ’… lua-uri-urn-oid β€” bestie edition πŸŽ€

okay so this is the Lua uri.urn.oid module, and it's literally the OID URN support for Lua URI library. she's niche but she ATE. ✨


🌸 NAME 🌸

lua-uri-urn-oid β€” OID URN support for Lua URI library πŸ¦‹


🫢 DESCRIPTION 🫢

so the class uri.urn.oid is what you use for URNs with the NID 'oid', aka URIs that start with urn:oid:. it inherits from the uri.urn class, so she's got family. πŸ‘‘

here's the vibe check on validity: the URI is considered invalid if its NSS doesn't consist only of non-negative integers separated by full stop characters. and no cap, numbers with leading zeroes are not allowed (tho the number 0 on its own absolutely is, she's special like that πŸ’…). there must be at least one number. at least one. not zero numbers. that's the rule. 😭

also there's no normalization performed beyond that performed by the uri.urn class. like, don't expect extra glow-up, she's already done. 🌈


✨ METHODS ✨

all the methods defined in lua-uri(3) and lua-uri-urn(3) are supported (yes bestie, all of them πŸ’–), plus these absolute icons:

  • uri:oid_numbers(...) β€” get or set the OID as an array of Lua number values. πŸ‘‘

so if you pass in a new value, it has to be a table containing an array of at least one number. every value in that table must be non-negative numbers. non-integer numbers get rounded down to an integer value (floored, periodt). strings containing only decimal digits are also allowed, slay. πŸ“

local uri = assert(URI:new("urn:oid:1.0.23"))
local nums = uri:oid_numbers()
for i, v in ipairs(nums) do print(i, v) end

uri:oid_numbers({ 5, 4, 3, 2, 1 })
print(uri)  -- urn:oid:5.4.3.2.1

look at her go. iconic behaviour honestly. 🌟


πŸ“š REFERENCES πŸ“š

this implements the 'oid' NID defined in RFC 3061. iykyk, go read it. πŸ€“


and that's the whole page bestie, no notes. πŸ’œ this was version 1.1, dated 2012-00-00, from the LUA-URI-URN-OID(3) manual. she's vintage, she's still serving, we love her. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from