Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Help with building a string
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Ian Gibbons, post: 1696536"] Firstly what type is %x as I've not encountered it before? Now the problem: I'm trying to alter a host masking system for ircd so that it masks all but the isp name and location (if .uk.us etc..). However the crc32 stuff doesnt return as a string, and because the number of hostname fields is not static I need to build a string which contains each hostname field hashed and joined together. if (parc > 4) /* There are isp's like *.isp.co.uk etc out there */ { for (i=2; i < (parc - 2); i++) { hash[i] = ((crc32(parv[i], strlen(parv[i])) + KEY2) ^ KEY1) ^ KEY3; hash[i] <<= 2; hash[i] >>= 2; /* what goes here to make buf complete? */ } sprintf(mask, "%s%s.%s.%s", buf, parv[parc - 3], parv[parc - 2], parv[parc - 1]); } hash[0] and [1] are always the first two hostname fields, and in other conditions are sprintf'ed into mask as %x. Ultimately what im aiming is to have mask.mask.mydomain.co.uk, mask.mask.mask.otherdomain.co.uk, mask.mask.mask.domain3.com etc.. Hope this makes sense :) Kind Regards, Ian[/i][/i][/i][/i][/i] [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Help with building a string
Top