refactor: 🔥 fuck you hash
Some checks failed
Check Types / tests (push) Failing after 1s
CodeQL / Analyze (javascript) (push) Failing after 0s
Lint & Format / tests (push) Failing after 0s
Mirror to Codeberg / Mirror (push) Failing after 0s

This commit is contained in:
Jesse Wierzbinski 2025-12-18 23:49:55 +01:00
parent 67bd6090e8
commit 1b243f1aca
No known key found for this signature in database
3 changed files with 5 additions and 18 deletions

View file

@ -21,6 +21,7 @@ This page lists changes since Working Draft 3. {{ className: 'lead' }}
- New endpoints have been defined under `/.versia/v0.6/` to fetch entities by their `id`. - New endpoints have been defined under `/.versia/v0.6/` to fetch entities by their `id`.
- Added [References](/types#reference) as a way to refer to other entities. - Added [References](/types#reference) as a way to refer to other entities.
- Changed usage of "`null` authors" to simply being an optional field. - Changed usage of "`null` authors" to simply being an optional field.
- Replaced the stupid `hash` field on [ContentFormat](/structures/content-format) with hex-encoded SHA-256.
- Added more guidelines on [JSON data handling](/json). - Added more guidelines on [JSON data handling](/json).
- Clarified the meaning of [Domain](/api/basics#domain) in the context of Versia. - Clarified the meaning of [Domain](/api/basics#domain) in the context of Versia.
- Changes to [Note](/entities/note): - Changes to [Note](/entities/note):

View file

@ -113,9 +113,7 @@ Notes represent a piece of content on a Versia instance. They can be posted by [
"duration": null, "duration": null,
"height": 960, "height": 960,
"size": 221275, "size": 221275,
"hash": { "hash": "967b8e86d8708c6283814f450efcbd3be94d3d24ca9a7ab435b2ff8b51dcbc21",
"sha256": "967b8e86d8708c6283814f450efcbd3be94d3d24ca9a7ab435b2ff8b51dcbc21"
},
"width": 639 "width": 639
} }
}, },
@ -130,9 +128,7 @@ Notes represent a piece of content on a Versia instance. They can be posted by [
"fps": null, "fps": null,
"duration": null "duration": null
"size": 8, "size": 8,
"hash": { "hash": "68c02dd11c179ef4d170b05393f6e72133dd0ad733f40d41b42363d8784e8d5d"
"sha256": "68c02dd11c179ef4d170b05393f6e72133dd0ad733f40d41b42363d8784e8d5d"
}
} }
} }
], ],

View file

@ -85,15 +85,7 @@ It is a good idea to provide at least two versions of an image (if possible): on
Size of the content in bytes. Size of the content in bytes.
</Property> </Property>
<Property name="hash" type="Hash" required={false}> <Property name="hash" type="Hash" required={false}>
Hash of the content. Encoded in hexadecimal. SHA-256 hash of the content. Encoded in hexadecimal.
```typescript
type HashNames = "sha256" | "sha512" | "sha3-256" | "sha3-512" | "blake2b-256" | "blake2b-512" | "blake3-256" | "blake3-512" | "md5" | "sha1" | "sha224" | "sha384" | "sha3-224" | "sha3-384" | "blake2s-256" | "blake2s-512" | "blake3-224" | "blake3-384";
type Hash = {
[key in HashNames]: string;
}
```
</Property> </Property>
<Property name="thumbhash" type="string" required={false}> <Property name="thumbhash" type="string" required={false}>
Image in [ThumbHash](https://evanw.github.io/thumbhash/) format. Image in [ThumbHash](https://evanw.github.io/thumbhash/) format.
@ -122,9 +114,7 @@ It is a good idea to provide at least two versions of an image (if possible): on
"remote": true, "remote": true,
"description": "A jolly horse running through mountains", "description": "A jolly horse running through mountains",
"size": 453933, "size": 453933,
"hash": { "hash": "91714fc336210d459d4f9d9233de663be2b87ffe923f1cfd76ece9d06f7c965d",
"sha256": "91714fc336210d459d4f9d9233de663be2b87ffe923f1cfd76ece9d06f7c965d"
},
"thumbhash": "3OcRJYB4d3h/iIeHeEh3eIhw+j2w", "thumbhash": "3OcRJYB4d3h/iIeHeEh3eIhw+j2w",
"width": 1920, "width": 1920,
"height": 1080 "height": 1080