FixedSizeStrings.jl
a type for efficiently storing short strings of known size
Install / Use
/learn @JuliaComputing/FixedSizeStrings.jlREADME
FixedSizeStrings.jl
This is a string type for compactly storing short strings of statically-known size. Each character is stored in one byte, so currently only the Latin-1 subset of Unicode is supported.
To use, call FixedSizeString{n}(itr), where n is the length and itr is an iterable
of characters. Alternatively, other string types can be converted to FixedSizeString{n}.
FixedSizeStrings works well in the following cases:
- Very short strings, e.g. <= 8 characters
- Storing many strings of the same length, when the number of unique strings is large
If you have a large array with a relatively small number of unique strings, it is
probably better to use PooledArrays with whatever string type is convenient.
TODO and open questions:
- Support more characters by adding a parameter for the representation (UInt16, UInt32)
- Does it make sense to support UTF-8?
- Possibly add
MaxLengthString, which is the same except can be padded with 0 bytes to represent fewer than the maximum possible number of characters.
Related Skills
node-connect
346.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
