[PATCHv2] commands: add md5/sha1/sha256sum commands using the digest api

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Wed May 18 03:50:00 EDT 2011


 
>  >> +	buf = xmalloc(4096);
> 
>  Jean-Christophe> do we really need to allocate the buffer everytime?
> 
> Not really, but it's simpler to do like this. It's only once per file so
> hardly a performance issue.
> 
>  >> +	while (*argv) {
>  >> +		char *filename = "/dev/mem";
>  >> +		ulong start = 0, size = ~0;
> 
>  Jean-Christophe> ulong so so if we want to support 64bit vfs we need to
>  Jean-Christophe> use an other type
> 
> ulong is what parse_area_spec and the other memory commands use.
Just note that the file size could be more than 32bit
and uze size_t or ssize_t make more sense in my mind
of we can use loff_t

Best Regards,
J.



More information about the barebox mailing list