near / borsh-rs

Rust implementation of Binary Object Representation Serializer for Hashing
https://borsh.io/
Apache License 2.0
306 stars 67 forks source link

feat(schema): for chars #292

Closed dzmitry-lahoda closed 5 months ago

dj8yfo commented 5 months ago

@dzmitry-lahoda this has been proposed earlier https://github.com/near/borsh-rs/pull/248/files . Does it look like what is required of this issue resolution?

dzmitry-lahoda commented 5 months ago

Indded, sorry. Was too Rust centric.

dzmitry-lahoda commented 5 months ago

@dj8yfo btw schema for chars, not serde for chars.

https://github.com/near/borsh-rs/issues/247#issuecomment-1772609940

i more of need metadata for chars, okey to have variable lengths.

i build something like reflection/diff of data storage of borsh.

dj8yfo commented 5 months ago

Indded, sorry. Was too Rust centric.

well, rust stdlib has an explanation that char is Unicode Scalar Value, serializing it as 21 bits or 4 bytes would be an implementation detail; 4 bytes would be a lot simpler