Skip to content

okumura/bswap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

What's 'bswap' ?

bswap is a C library for byte order swapping.

  • works in Visual C++ and GCC
  • optimized for x86/x86_64/ARMv6
  • no external dependencies on anything, including the C run-time library

Usage

#include "bswap.h"
#include <stdio.h>

int main() {
	unsigned short u16 = 0x1234;
	unsigned int u32 = 0x12345678;
	unsigned long long u64 = 0x123456789abcdefL;

	printf("%04x -> %04x\n", u16, bswap_16(u16));
	printf("%08x -> %08x\n", u32, bswap_32(u32));
	printf("%016llx -> %016llx\n", u64, bswap_64(u64));

	return 0;
}

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages