algo
  chibihash64 hash
  crc16 modbus
  exponential blur
  fast log2 for integers
  fnv1a hash
  kelvin to rgb
  prime integer check

cmds
  apprentice gdb operator guide
  bash native network socket
  convert bases using bc
  count source lines of code
  create allocate large big file
  diff compare directories
  dirty python web server
  display pressed keys
  get network manager wifi password
  install root on encrypted zfs
  list fonts
  permit doas to user
  read midi events
  resolve host name via dns lookup
  send files to android device
  swap capslock with escape in console
  valgrind kcachegrind callgrind

cooking
  cherry pie
  chicken cutlets
  fast pizza
  greek meat pie
  salat valin
  shchi
  tefteli

curl
  get current geolocation
  get weather
  track server redirect chain

devices
  keyboards
  mouses

ffmpeg
  attach subtitles track to video file
  convert audio file to wav format
  crop video
  cut audio
  negate video
  record screen display
  reverse audio file contents
  speed up video

gifsicle
  crop gif

gimp
  make image contrast

gitlab
  unprotect branch

git
  clone only last commit
  push only one commit
  save changes as patch
  uncommit last commit

imagemagick
  flip image

latex
  aliases
  dual section name
  font sizes
  indent first paragraph
  insert table of contents
  page numbering
  plotting
  russian language
  show frame
  stress
  system of equations

linux
  block icmp traffic using bpf
  change default network ttl
  get random uuid
  get stack trace of threads in a running process
  write to serial port

mpv
  multiple subtitles
  play remote files through mpv over ssh

nmap
  check port

notes
  why you should not do user interface in c

octave
  install package

pacman
  remove packages from the cache

pdf
  extract page range from pdf file
  merge pdf files

rsync
  sync remote directory to local directory

sed
  extract every nth character from string

sox
  ambient ventilation noise

ssh
  dynamic port forwarding via socks server

sway
  list windows

virtualbox
  install guest additions

xorg
  disable input device
  enable xorg touchpad tapping and dwt
  keyboard en ru layout and swap esc caps
  x documents reference

yt-dlp
  download all videos from user channel

FNV-1a (Fowler–Noll–Vo) hash function

#include <stdio.h>
#include <inttypes.h>

int main(void) {
	uint64_t hash = 14695981039346656037ULL;
	for (char c = getchar(); c != EOF; c = getchar()) {
		hash = (hash ^ c) * 1099511628211ULL;
	}
	printf("%" PRIu64 "\n", hash);
	return 0;
}

Constants

FNV seed

  • 32 bit: 2166136261
  • 64 bit: 14695981039346656037
  • 128 bit: 144066263297769815596495629667062367629
  • 256 bit: 100029257958052580907070968620625704837092796014241193945225284501741471925557
  • 512 bit:
    96593031294966694980094354007163104660904
    18745672637896108374329434462657994582932
    19771643844981305189220653980578449532823
    9340083876191928701583869517785
    
  • 1024 bit:
    14197795064947621068722070641403218320880
    62279544193396087847491461758272325229673
    23037177221508640965212023555493656281746
    69108571814760471015076148029755969804077
    32015769245856300321530495715015740364446
    03635505054127112859663616102678680828938
    23963790439336411086884584107735010676915
    

FNV prime

  • 32 bit: 2^24 + 2^8 + 0x93 = 16777619
  • 64 bit: 2^40 + 2^8 + 0xb3 = 1099511628211
  • 128 bit: 2^88 + 2^8 + 0x3b = 309485009821345068724781371
  • 256 bit: 2^168 + 2^8 + 0x63 = 374144419156711147060143317175368453031918731002211
  • 512 bit: 2^344 + 2^8 + 0x57 =
    35835915874844867368919076489095108449946
    32795575439255839982561542066993888257512
    6094039892345713852759
    
  • 1024 bit: 2^680 + 2^8 + 0x8d =
    50164565101131186554345988110352789550307
    65345404790744303017523831112055108147451
    50915769222029538271616265187852689524938
    52922918165243750837466913718040942718731
    60484737966720260389217684476157468082573
    

Sources

  • https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
  • http://isthe.com/chongo/tech/comp/fnv
  • https://datatracker.ietf.org/doc/html/draft-eastlake-fnv-17.html