oid36/README.md

20 lines
349 B
Markdown
Raw Normal View History

2023-08-03 14:44:56 +02:00
# oid36
encode ObjectID to Base36 and back
```go
id := primitive.NewObjectID().Hex()
fmt.Println(id)
out, e := oid36.ObjectIDToBase36(id)
if e != nil {
t.Error(e)
t.Fail()
return
}
fmt.Println(out)
```
### Acknowledgements
Shamelessly stolen base36 code from [github.com/martinlindhe/base36](https://github.com/martinlindhe/base36).