Algorithm for getting Mnemonic Seed from 256-bitsHexadecimal Seed

How to get Mnemonic Seed from 256 bits of Hexadecimal Seed?
For example, on Cryptonote Address Tests I can to fill the Hexadecimal Seed field, push “Gen 1.”-button and get Mnemonic Seed.
I search the algorithm (text or C+±function without many libraries, maybe using only some function for getting hash to add check-bytes to the end (Keccak-256 as I understand)).
For example, for BTC (24 words from 256 bits) answer is “1. Get SHA256. 2. Put the first byte to the end. 3. Cut this 33 bytes into 24 11-bits words. 4. Get each word from bip39 wordlist.”.

Hi!

Probably best to ask this in Reddit - Dive into anything