libft
Loading...
Searching...
No Matches
Functions
ft_utils.c File Reference

General-purpose utility functions. More...

#include "libft.h"
+ Include dependency graph for ft_utils.c:

Functions

int ft_rand (int min, int max)
 Returns a random integer in the range [min, max] using xorshift32.
 
void ft_swap (void *a, void *b, size_t size)
 Swaps the contents of two memory blocks.
 
static unsigned int xorshift32 (unsigned int *state)
 Performs a 32-bit xorshift operation to generate a pseudo-random number.
 

Detailed Description

General-purpose utility functions.

Author
Toonsa
Date
2025-04-05

This file contains reusable helpers such as ft_swap for memory-safe value swapping, and ft_rand for pseudo-random integer generation using the xorshift32 algorithm.