infobloxopen / atlas-app-toolkit

This repository provides common Go utilities and helpers that are reusable from project-to-project. The goal is to prevent code duplication by encouraging teams to use and contribute to toolkit libraries. The toolkit is not a framework. Rather, it is a set of (mostly gRPC-related) plugins and helpers.
Apache License 2.0
99 stars 115 forks source link

bloxid: added WithRandomEncodedID to transform bloxid unique id to full bloxid #310

Closed wplu closed 2 years ago

wplu commented 2 years ago

DEMO:

~/src/github.com/infobloxopen/atlas-app-toolkit/bloxid
# wlu@rm-ml-wlu: go test -v
...
=== RUN   TestHashIDInttoIntDeprecated
=== RUN   TestHashIDInttoIntDeprecated/Valid_input
=== RUN   TestHashIDInttoIntDeprecated/Negative_number
--- PASS: TestHashIDInttoIntDeprecated (0.00s)
    --- PASS: TestHashIDInttoIntDeprecated/Valid_input (0.00s)
    --- PASS: TestHashIDInttoIntDeprecated/Negative_number (0.00s)
=== RUN   TestHashIDInttoInt
=== RUN   TestHashIDInttoInt/Valid_input
=== RUN   TestHashIDInttoInt/Negative_number
--- PASS: TestHashIDInttoInt (0.00s)
    --- PASS: TestHashIDInttoInt/Valid_input (0.00s)
    --- PASS: TestHashIDInttoInt/Negative_number (0.00s)
...
=== RUN   TestGenerateV0WithExtrinsicIDDeprecated
--- PASS: TestGenerateV0WithExtrinsicIDDeprecated (0.00s)
=== RUN   TestGenerateV0WithExtrinsicID
--- PASS: TestGenerateV0WithExtrinsicID (0.00s)
=== RUN   TestGenerateV0WithRandomEncodedID
--- PASS: TestGenerateV0WithRandomEncodedID (0.00s)
=== RUN   TestGenerateV0RandomEntityID
    v0_test.go:445: created random scheme bloxid: blox0.iam.group.us-com-1.mb77dnuidm75moy53fxgbvys7riobdkp
--- PASS: TestGenerateV0RandomEntityID (0.00s)
PASS
ok      github.com/infobloxopen/atlas-app-toolkit/bloxid    0.656s