External Program
Adrien Monteleone
adrien.monteleone at gmail.com
Sat Jun 11 11:45:29 EDT 2016
Yep, that simple. At least from what I see here in the docs: http://svn.gnucash.org/docs/head/group__GncGUID.html, If that link doesn't post then do a search on "GnuCash GUID" and it should be the second or so result titled 'GnuCash: GUID' as a link to the SVN docs. Also, check out guid.cpp in the source. (in case you can't find that page, which is essentially the source documentation.)
Personally I would feel better about them being unique to the transaction if a timestamp and maybe the relevant accounts and books were used as seeds. If you do that search you will also come across a 'Design Issues' partial document lamenting the problem with uniqueness in the case of backup copies and future editing. I would think constructing the ID to be based off of books, accounts, and other info in the transaction, along with a time stamp, and THEN add a random component would be a more robust solution, but probably somewhat complicated. Perhaps a hash of the transaction info or a combination of hash and random number would be easier.
-Adrien
> From: Mark Mercer <markm at woodjoint.ca>
> Date: June 10, 2016 10:00:50 PM CDT
> To: Adrien Monteleone <adrien.monteleone at gmail.com>
> Cc: gnucash-user at gnucash.org
> Subject: Re: External Program
>
>
> So yup, that fixed it! So happy now.
>
> The only issue that comes to mind now is how do I make sure I don't generate duplicate guid's. How does gnucash do it? it cant be as simple as generate random ones and assume that the set is so large that there would never be a duplicate.
>
>
> On 10/06/2016 11:22 PM, Adrien Monteleone wrote:
>> Mark, I'd say right off that since the letter 'M' is not a valid hex number, GC is probably choking on it. I'm not familiar with generating guid's but since the ones generated by GC itself are hex values, I'd suspect you'd need to stick to that numbering system. If it would work, perhaps the ASCII value for 'M' as a hex would suffice, though I'm not sure if this creates any other issues with guid's. (thus "M" which is '77' ASCII is '4d' Hex)
>>
>> -Adrien
>>
More information about the gnucash-user
mailing list