编辑
2023-11-13
数据结构与算法
00

SipHash算法是一种针对短消息设计的伪随机函数族,可用于消息认证和作为MAC算法使用。它由Jean-Philippe Aumasson等人于2012年设计,结合了BLAKE、Skein和JH等算法的特点[1]

算法描述

通常具体的SipHash算法表示为SipHash-c-d,其中c和d分别表示压缩轮数和终结轮数。SipHash算法的步骤如下:

初始化阶段

  1. 初始化四个64位的内部状态字v0, v1, v2, v3,其中v0=k0⊕736f6d6570736575,v1=k1⊕646f72616e646f6d,v2=k0⊕6c7967656e657261,v3=k1⊕7465646279746573。这里的k0和k1是密钥k的小端编码的64位字,初始状态的常数对应于大端编码的ASCII字符串“Somepseudorandomlygeneratedbytes”。
编辑
2023-11-13
linux
00

systemd是一个用于Linux操作系统的软件套件,它提供了一系列系统组件。它的主要目标是在Linux发行版之间统一服务配置和行为[1]。systemd的主要组件是一个"系统和服务管理器",它是用于引导用户空间和管理用户进程的init系统。它还提供了各种守护进程和实用工具的替代品,包括设备管理、登录管理、网络连接管理和事件日志记录[1]

编辑
2023-11-12
英语学习
00

Overview

The Linux kernel requires very little moderation from a system user or system administrator. Designed to be forgotten, the Linux kernel handles a computer’s drivers and low level processes. The weight of the kernel’s code makes manual editing, while possible, proves difficult and most kernel maintenance is done through kernel upgrades. All Linux distributions provide the opportunity to upgrade the kernel, but depending on the release structure and maintainers looks different. Arch-based systems will upgrade the kernel when a new kernel is pushed to the repository, where more stability focused distributions such as Debian and derivatives do not upgrade from the standard package manager. As a rule of thumb with much of technology, if you do not see any performance or stability concerns, it may be best to leave the kernel as is.

编辑
2023-11-12
linux
00
  1. Linux:Linux操作系统通常使用GRUB2(或GRUB v2)作为默认的引导加载程序[1]。GRUB2是Linux的事实标准引导加载程序,它具有强大的功能和灵活性,可以支持多个操作系统的引导。

  2. Windows:Windows操作系统使用BOOTMGR作为引导加载程序[1]。BOOTMGR负责加载Windows操作系统,并提供引导菜单以选择不同的启动选项。

编辑
2023-11-12
Redis源码阅读
00

创建zset

c
robj *createZsetObject(void) { zset *zs = zmalloc(sizeof(*zs)); robj *o; zs->dict = dictCreate(&zsetDictType); zs->zsl = zslCreate(); o = createObject(OBJ_ZSET,zs); o->encoding = OBJ_ENCODING_SKIPLIST; return o; }