automerge/automerge-swift

extend ChangeHash internal initializer to use Automerge core logic

Open

#193 opened on Jul 13, 2024

 (0 comments) (0 reactions) (0 assignees)Swift (25 forks)auto 404
enhancementgood first issue

Repository metrics

Stars
 (320 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

From #191 :

In the automerge crate we have a TryFrom<&[u8]> implementation for ChangeHash. This is the supported way of converting bytes into a ChangeHash and is where we would handle future inconsistencies in hash format (not that I expect any at this point). If possible I think it would be best to expose this method up through the Uniffi UDL rather than assuming that any 32 byte array is a valid change hash. (This also applies to the serialization step, except we're already using ChangeHash::as_bytes when we generate the bytes which we pass to the Swift side).

Contributor guide