format bin2hex added.
FossilOrigin-Name: 0dbf2c7be7439d6077b5927f4e5050b844fa9f013336e41178b78343a29e7f06
This commit is contained in:
		@ -30,8 +30,19 @@
 | 
			
		||||
 | 
			
		||||
extern int format_hex_bytes(char *dst, const char *format, const char *delim,
 | 
			
		||||
			   const uint8_t * src, int len);
 | 
			
		||||
extern int format_scan_hex_bytes(uint8_t *dst,const char *s, int len);
 | 
			
		||||
 | 
			
		||||
static inline char * format_s_hex_bytes(char *dst, const char *format, const char *delim,
 | 
			
		||||
			   const uint8_t * src, int len){
 | 
			
		||||
	format_hex_bytes(dst,format,delim,src,len);
 | 
			
		||||
	return dst;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define format_bin2hex(src,len) (format_s_hex_bytes((char[(len)*2+1]){0},"%02X","",src,len))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
extern int format_scan_hex_bytes(uint8_t *dst,const char *s, int len);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user