[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/dmpas/OneScript/develop/tests/binary-objects.os [Back]  [Original]

 ;

////////////////////////////////////////////////////////////////////
//  

 () 
	
	 = ;
	
	 =  ;
	
	.("_");
	.("_");
	.("_");
	.("_");
	.("_16");
	.("_16BigEndian");
	.("_32");
	.("_32BigEndian");
	.("_64");
	.("_64BigEndian");
	.("_");
	.("_");
	.("_");
	.("_");
	.("_");
	.("_");
	.("_");
	.("_");
	.("_");
	.("_");
	.("_");
	.("_");
	.("_");
	.("_");
	
	.("_");

	 ;
	


 () 
	
	.();
	


 ()

	 =  (10);
	  = 0  9 
		[] = +1;
	;

	 ;
	


 _() 
	
	 = ();
	.(10, .);
	  = 0  .-1 
		.(+1, [], "    " + );
	;
	


 _() 
	
	 = ();
	 =  (.);
	
	.(0, );
	.(., .);
	  = 0  .-1 
		.([], [], "   " + );
		.(+1, [], "    " + );
	;
	
	 =  (5);
	.(0, , 5);
	  = 0  .-1 
		.([], [], "     " + );
	;
	


 _() 
	
	 = ();
	 = .(2,2);
	
	.(2, .);
	.(3, [0]);
	.(4, [1]);
	


 _16() 
	
	 =  (4);
	.16(0, 255);
	.(255, .16(0));
	


 _16BigEndian() 
	
	 =  (4);
	.16(0, 255);
	.(65280, .16(0, .BigEndian));
	


 _32() 
	
	.();
	
	 =  (4);
	.32(0, 4278190080);
	.(4278190080, .32(0));
	


 _32BigEndian() 
	
	 =  (4);
	.32(0, 255);
	.(4278190080, .32(0, .BigEndian));
	


 _64() 
	
	 =  (8);
	.32(0, 255);
	.(255, .32(0));
	


 _64BigEndian() 
	
	 =  (8);
	.64(0, 255);
	.(18374686479671623680, .64(0, .BigEndian));
	


 _() 

	 =  (100);
	 =  ;
	 =  (10);
	 =  ();
	.(10, .());

	.();
	.(10, .());
	


 _() 
	
	//  
	 = .(., ().);
	.();
	
	 =  (()., .);
	.();
	
	//     
	 = .(., ()., .);
    .();
    
     =  (()., ., .);
    .();
    
    //     
     = .(., ()., 4096);
    .();
    
     =  (()., ., 4096);
    .();
    
    //  ,     
     = .(., ()., ., 4096);
    .();
    
     =  (()., ., ., 4096);
    .();
	


 _() 
	 = ();
	 = .();
	 = .();
	.(, 0, .);
	.();
	
	 =  ();
	.(.());
	.(10, .());
	


 _() 
	 =  ((()., "templateslib/TemplateData.txt"));
	 =  ();
	 = .();
	
	.(",  ", );


 _() 

	 =  ((()., "templateslib/TemplateData.txt"));
	 =  ();
	.(3);
	 = .();

	.(",  ", , "");
	.();

	 =  ();
	.(3);
	 = .(0);
	.(",  ", , " ");
	.();



 _() 

	 = "- ";
	 = "UTF-8";

	 =  ;
	
	 =  (, );
	.(, );
	.();
	
	.(0, .);
	
	 = .();



 _() 

	 = Hex("01 02 03 04");

	
		 = Hex("01 02 03");
		.(3, );
	
		.((), "    ");
	;

	
		 = Hex("01 02 03");
		.(0, );
	
		.((), "    ");
	;

	
		 = Hex("01 02 03");
		.(1, , 3);
	
		.((), "    ");
	;

	
		 = Hex("01 02 03");
		.(-1, , 3);
	
		.((), "     ");
	;



 _() 

	 = Hex("01 02 03 04");
	
	 = Hex("01 02 03");
	.(0, Hex("01 02 03"));
	.(Hex(), "000000");

	 = Hex("01 02 03");
	.(0, , 3);
	.(Hex(), "000000");

	 = Hex("01 02 03");
	.(1, , 2);
	.(Hex(), "010002");
	
	 = Hex("01 02 03");
	.(1, , 2);
	.(Hex(), "010303");
	
	 = Hex("01 02 03");
	.(1, , 2);
	.(Hex(), "010201");
	
	 = Hex("01 02 03");
	.(1, , 2);
	.(Hex(), "010301");

	 = Hex("00 00 00");
	.(1, , 2);
	.(Hex(), "000102");



 _() 

	 = Hex("1b1ec4166a11c03b3afefaea442e7709").();
	.(.);
	.(.);
	.(.);



 _() 

	 =  ();
	 =  (10);
	.(, 0, 10); //  - 

	//     
	 = .();

	// ,     read-only
	.(.);

	//        -   
	
		.( (10), 0, 10);
		 "        ,    ";
	
		 = ().;
		.(, "      ");
	;

	//  ,     
	
		.(20);
		 "        ,    ";
	
		 = ().;
		.(, "      ");
	;



 _() 

	//    
	 =  ();
	 =  (20);
	
	//   
	  = 0  19 
		.(,  + 1);
	;
	
	.(, 0, 20);
	.(20, .());
	.(20, .());
	
	//    
	.(0, .);
	.(0, .());
	
	//     
	 = .();
	
	// ,    
	.(0, .());
	
	//     5  -      
	 =  (5);
	.(, 0, 5);
	
	// ,      
	.(5, .());
	.(5, .());
	
	//        3 
	2 =  (3);
	.(2, 0, 3);
	
	// ,      
	.(8, .());
	.(8, .());
	
	// ,    -    6-  8- ( 6, 7, 8)
	.(6, 2.(0));
	.(7, 2.(1));
	.(8, 2.(2));
	
	//       
	.(15, .);
	
	// ,      
	.(15, .());
	.(15, .());
	
	//      (  15)
	 =  (2);
	.(0, 100);
	.(1, 200);
	.(, 0, 2);
	
	//      
	.(17, .());
	.(17, .());
	
	//    15       
	.(15, .);
	3 =  (2);
	.(3, 0, 2);
	
	// ,      -    
	.(100, 3.(0));
	.(200, 3.(1));



 _() 

	 = Hex("1b1e c416 6a11 c03b 3afe faea 442e 7709");
	 = .();

	 =  (.SHA256);
	.(, 2);
	.(
		"0b427acd4088d248408e38b34fb378172a05bd71e58b384f5b279beea7aea467",
		(Hex(.)));
	.(2, .());

	.(, 12);
	.(
		"2a0815b87888a03406d7ab482b965361eb96112db88e8ab6ea214cb107ee8469",
		(Hex(.)));
	.(14, .());

	.(, 4);
	.(
		"817eece1eff577a2d28f1478f496e3880f360611d1f264086fd77cf338464654",
		(Hex(.)));
	.(16, .());

	.(, 4);
	.(
		"817eece1eff577a2d28f1478f496e3880f360611d1f264086fd77cf338464654",
		(Hex(.)));
	.(16, .());

	 =  (.SHA256);
	 = .();
	.(2, .);
	.();
	.(
		"bda43a0f1c70decfa45d8a2825e6f6facfe0ef11e385794803a165f209b56737",
		(Hex(.)));
	.(16, .());



 _() 

	 = Hex("1b1e c416 6a11 c03b 3afe faea 442e 7709");

	 =  (.SHA256);
	.();
	.(
		"817eece1eff577a2d28f1478f496e3880f360611d1f264086fd77cf338464654",
		(Hex(.)));



 _() 

	 =  ;
	.("1");
	.("2");
	.("3");
	 = "123";
	
	 = ((, ));
	 = ();

	 = .();

	.(.(), 3, "  -  ");

	  = 0  .() 

		 = ([]);
		.(, [], "    ");

	;



 _() 

	 =  ;
	.("1");
	.("2");
	.("3");
	.("4");
	.("5");
	
	 = "1\R\R\N2\R\N3\N4\R5";
	
	 = ();
	 =  ;
	.(("\N"));
	.(("\R\N"));
	.(("\R"));
	.(("\R\R\N"));
	
	 = .();
	
	.(.(), 5);
	
	  = 0  .() 
		
		 = ([]);
		.(, [], "    ");
		
	;



 _() 
    
     = ();
    .();
     =  ();
     =  (.());
    
     = 0;
      

Web Proxy Viewer  |  New URL  |  Original Page