Base32768 encoding/decoding in Godot
Find a file
2025-04-18 15:29:15 -04:00
addons/base32768 singleton is not necessary anymore moved to a static class 2025-04-18 15:29:15 -04:00
.gitattributes trying stuff with the zip export 2025-04-16 23:13:54 -04:00
.gitignore remove tests from git 2025-04-17 19:16:33 -04:00
godot-worm.png added random logo XD 2025-04-16 23:24:44 -04:00
LICENSE.txt first release ? 2025-04-16 23:11:38 -04:00
README.md added two higher level functions to process objects instead of packedByteArrays 2025-04-17 19:15:44 -04:00

Base32768

Base32768 is a binary encoding optimised for UTF-16-encoded text.

This Godot plugin is an implementation of an already existing javascript plugin in gdscript. Link to the original repository : https://github.com/qntm/base32768

Usage

var toTranslate = "testma"

toTranslate.to_utf8_buffer()
# [116, 101, 115, 116, 109, 97]

var encoded = Base32768.encode(toTranslate.to_utf8_buffer())
# "悒茽㇌Ɵ"

var decoded = Base32768.decode(encoded)
# [116, 101, 115, 116, 109, 97, 0, 0]

decoded.get_string_from_utf8()
# "tesma"
var toTranslate = { "test": "testma", "yes": "no" }

var encoded = Base32768.Oencode(toTranslate)
# "揥☽Ⰾ嶢㠑ݩ輪駔崐滫ᄤ䷶凹⚈暤铏㝅䖿"

var decoded = Base32768.Odecode(encoded)
# { "test": "testma", "yes": "no" }