LUA-URI-URN-OID(3)
π 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
- debian trixie: lua-uri 0.1+20130926+git14fa255d-3 Β· MIT
- ubuntu noble: lua-uri 0.1+20130926+git14fa255d-3 Β· MIT
- ubuntu questing: lua-uri 0.1+20130926+git14fa255d-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms