misc.c (83551) | misc.c (91754) |
---|---|
1/* 2 * Copyright (c) 1999 3 * University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 26 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1999 3 * University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 26 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/lib/libcrypt/misc.c 83551 2001-09-16 21:35:07Z dillon $"); | 31__FBSDID("$FreeBSD: head/lib/libcrypt/misc.c 91754 2002-03-06 17:18:09Z markm $"); |
32 | 32 |
33static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ | 33#include <sys/types.h> 34 35#include "crypt.h" 36 37static char itoa64[] = /* 0 ... 63 => ascii - 64 */ |
34 "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; 35 36void | 38 "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; 39 40void |
37_crypt_to64(s, v, n) 38 char *s; 39 unsigned long v; 40 int n; | 41_crypt_to64(char *s, u_long v, int n) |
41{ 42 while (--n >= 0) { 43 *s++ = itoa64[v&0x3f]; 44 v >>= 6; 45 } 46} | 42{ 43 while (--n >= 0) { 44 *s++ = itoa64[v&0x3f]; 45 v >>= 6; 46 } 47} |