efi_crc32(9)
π efi_crc32(9) β the EFI-flavoured crc32, bestie
okay so this is a page from the Kernel API Manual, and honestly? it's a little baddie of a function. let's get into it β¨
πΈ NAME πΈ
efi_crc32 β it's giving "EFI version of crc32 function", and that's literally the whole vibe π
π¦ SYNOPSIS π¦
u32 efi_crc32 (const void *buf , unsigned long len );
no cap, that's the whole signature. she's short, she's sweet, she takes two things and gives you back a u32. periodt π
β¨ ARGUMENTS β¨
bufβ the buffer you want the crc32 of, like that's the whole thing she's chewing on π«Άlenβ the length ofbuf. yes bestie, you do have to tell her how long it is, she's not psychic π
π DESCRIPTION π
so the tea is: this one returns the EFI-style CRC32 value for buf π§ and the way it does it is honestly so specific:
- it uses the little endian Ethernet polynomial (iconic, classic, we love her)
- but it seeds the function with
~0 - and then xor's with
~0at the end
that's the whole recipe. seed with ~0, cook, xor with ~0. slay π₯
π now listen, bestie, here's a fun historical lil' detail: the EFI Specification, v1.02, has a reference to Dr. Dobbs Journal, May 1994 β except actually it's in May 1992. yeah. the spec got the date wrong. not me clocking that ππ
π SEE ALSO π
go check out the kernel file ./block/partitions/efi.c, plus all her besties in the group chat π:
last_lba(9)is_pmbr_valid(9)read_lba(9)alloc_read_gpt_entries(9)alloc_read_gpt_header(9)is_gpt_valid(9)is_pte_valid(9)compare_gpts(9)find_valid_gpt(9)utf16_le_to_7bit(9)efi_partition(9)
and also the directory ./block/partitions, because that's where all of this lives π¦
β and that's the page!! one last lil' sign-off, mwah π: this one comes from ./block/partitions, dated October 2026, and it's living its best life inside the Kernel API Manual as efi_crc32(9). go forth and checksum, queen πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms