Skip to content

Stable sort for HashSet #256

@streetycat

Description

@streetycat

Discussed in #253

Originally posted by streetycat May 6, 2023
I am reviewing the encoding format for types. But I find that our encoding process only explicitly sorts the HashMap. Other types(as HashSet/BTreeMap/BTreeSet) depends on the iter in Rust. I have read the documents for those types, The iters for BTreeMap and BTreeSet return elements in ascending order. but I have not found how it is sorted in HashSet.

I am reading the code in raw_types.rs.

I think we have to explicitly define the encoding order of the fields/elements of the composite type, otherwise different results may be encoded.

Metadata

Metadata

Assignees

Labels

CodecEncode & Decode for the ObjectObjectObject design, codec and usagebugSomething isn't workingcyfs-baseFunctions and components in cyfs-base project

Type

No type

Projects

Status

🧪To Test

Relationships

None yet

Development

No branches or pull requests

Issue actions