guid

ofbiz保存jsp页面数据

别说谁变了你拦得住时间么 提交于 2019-12-03 17:22:56
1、前台js保存 <script type="text/javascript" src="/ecloud/js/js/jquery.min.js"></script> <script type="text/javascript"> $(function(){ //发送验证码 $("#saveButton").click(function(){ var templateName = $("#templateName").val(); if(templateName == ""){ alert("请输入模板名称"); return; } $.ajax({ url:"control/PrintTemplateSaveServlet", data:{ guid:$("#tId").val(), planId:$("#planId").val(), userId:$("#userId").val(), templateName:$("#templateName").val(), templateContent:$("#print_content").html(), width:$("#template_width").val(), height:$("#template_height").val() /* , templateStyle:$("#print_style").html() */

Using Guid as Id column in NHibernate causes format exception when using MySQL

我只是一个虾纸丫 提交于 2019-12-03 16:56:23
When I define the NHibernate entity/mapping to use Guid as identity column I receive an exception. The Guid column is generated as a varchar(40), but the content seem to be binary. Is there a solution to this? For now I'm just using plain ol' int, but it would be nice to know for future projects! :) MySql Connector documentation states that from version 5.2 of .NET connector they treat GUID's as BINARY(16) not VARCHAR(40) . Since current MySQL dialect in nhibernate doesn't updated to reflect this change (actually an issue is prepared) you need to manually convert these fields to BINARY(16)

Are there any inobvious ways of abusing GUIDs?

北慕城南 提交于 2019-12-03 16:41:57
GUIDs are typically used for uniquely identifying all kinds of entities - requests from external systems, files, whatever. Work like magic - you call a "GiveMeGuid()" (UuidCreate() on Windows) function - and a fresh new GUID is here at your service. Given my code really calls that "GiveMeGuid()" function each time I need a new GUID is there any not so obvious way to misuse it? Rubens Farias Just found an answer to an old question: How deterministic Are .Net GUIDs? . Requoting it: It's not a complete answer, but I can tell you that the 13th hex digit is always 4 because it denotes the version

Is there any way to generate a guid in ANT?

萝らか妹 提交于 2019-12-03 15:54:47
问题 I have an ant script to manage out build process. For WiX I need to produce a new guid when we produce a new version of the installer. Anyone have any idea how to do this in ANT? Any answer that uses built-in tasks would be preferable. But if I have to add another file, that's fine. 回答1: I'd use a scriptdef task to define simple javascript task that wraps the Java UUID class, something like this: <scriptdef name="generateguid" language="javascript"> <attribute name="property" /> <![CDATA[

is a GUID a good salt? is my register/login process got any flaw?

十年热恋 提交于 2019-12-03 15:44:21
问题 If my table inside the database look like: userid uniqueidentifier username varchar(20) password varbinary(max) When the user submit(to register), I send the user/pass to a stored procedure. The stored procedure create a new GUID(Using NEWID()) then I use the HashBytes(sha1) function of SQL Server to create the password based on the GUID+password provided then I insert the values into the table above. When the user submit(to login), I send the user/pass to a stored procedure. The stored

Data localization in SQL Server with GUIDs or…?

三世轮回 提交于 2019-12-03 15:13:06
I need to make a database that is highly localized. For almost all entities I need a translation to 5+ languages. Some entities even require and additional resource localized (like images which I enter as paths). The question now is: 1: LOOKUP TABLE PER ENTITY/TABLE (kinda bloated schema?) should I create a "Localized" localization lookup table for each table I need localized values (and use standard int/bigint PKs for elements) Like here: MYITEMS ------- - MyItemId BIGINT PK - MyItemPrice DECIMAL MYITEMLOCALIZED --------------- - CPK_MyItemId BIGINT FK - CPK_LanguageCode NCHAR - LocalizedName

Generating a unique *and* random URL in C#

南笙酒味 提交于 2019-12-03 12:05:47
My ultimate goal is to create a URL that is unique and cannot be guessed/predicted. The purpose of this URL is to allow users to perform operations like verifying their email address and resetting their password. These URLs would expire within a set amount of time (currently set to 24 hours). I was originally using a Guid for this purpose, but I now understand this to be somewhere between "just fine" and "very insecure", depending on which expert you listen to. So, I thought I'd beef up my code a little bit, just in case. At first I thought I'd just stick with using a Guid , but generate it

Is there any way to create a short unique code like short GUID?

♀尐吖头ヾ 提交于 2019-12-03 11:39:55
问题 I want to create a short GUID. Is there any way to create a short unique code like short GUID? I want to create a ticket tracking number. 回答1: The length of GUID is 128bits(16bytes), so if you want to create a short GUID , you have to change GUID's encoding. For instance, you can user base64 or ASCII85. /// <summary> /// Creates a GUID which is guaranteed not to equal the empty GUID /// </summary> /// <returns>A 24 character long string</returns> public static string CreateGuid() { Guid guid

webupload分片上传

非 Y 不嫁゛ 提交于 2019-12-03 11:07:58
参考博客: https://blog.csdn.net/niugang0920/article/details/89387209 js代码:    mini.parse(); function webUploader(e, type) { var serverUrl; var typeError; var KjURL = '/tst-api/kjfile/upload';//重点文件上传路径 var ImgURL = '/tst-api/file/horizontalThumbnailUpload'; var fileArray = []; var accept; var chunkSize; var $list; var $notChoose; var size; if (type == 'file') { serverUrl = KjURL; $list = $('#fstatus'); $notChoose = $('#fdiv'); chunkSize = 1 * 1024 * 1024; size= 500 ; typeError = '只能上传带有内容的word,pdf和mp4,wmv,mov,flv,avi,3gp,mkv格式的视频文件'; accept = {//格式校验 title: 'file', extensions: 'pdf,doc,docx,mp4

How should I create my GUID?

梦想与她 提交于 2019-12-03 10:53:20
I'm going to be uploading images to a system and need them to be referenced by a non-sequential unique ID. I've read a little about GUIDs, and I'm wondering what the best approach to making one in PHP is. Should I md5() the current timestamp and salt it, or will PHP's uniqueid ( http://www.php.net/manual/en/function.uniqid.php ) function be sufficient enough? Thanks! EDIT: Yikes! I forgot about this ancient answer of mine. To clarify confusion created by my naivety (consistent with the comments made below): MD5 (like most useful hashes, by their nature) are not injective, so their output is