get https://api.rakun.app/get/id//
Get an item by its hashed ID
This is what the Rakun Website relies on for it's users. This endpoint allows for ID's that are reliably hashed so links can be re-visited for later. Like the MyAnimeList and Anilist ID, it requires a collection to get from.
Hashing is simple, and goes as follows. The hashed ID is the result of the MAL name
+ the item type (title-cased)
hashed in MD5. For example, to get the ID for Cowboy Bebop
you would hash Cowboy BebopAnime
in MD5 to get ebf78d6afa7d70a0a0c8a733efe50cdf
as the ID. Here are some code examples of simple MD5 hashing.
import hashlib
def getHashedID(name: str, type: str):
hashlib.md5((name, type).encode()).hexdigest()
var CryptoJS = require("crypto-js");
function getHashedID(name, type) {
CryptoJS.MD5(name + type).toString();
}
use std::env;
use std::hash::{Hash, Hasher};
use std::collections::hash_map::DefaultHasher;
fn get_hashed_id(name: &str, type: &str) -> String {
let mut hasher = DefaultHasher::new();
(name, type).hash(&mut hasher);
format!("{:x}", hasher.finish())
}